package com.fabriciojf.exemplos;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * Modelo de persistencia via jdbc
 *
 * @author Fabricio S Costa fabriciojf@gmail.com
 * @since 01/12/2009
 * @version 1.0
 */
public class DatabaseLocator {
  private static DatabaseLocator instance = new DatabaseLocator();
  public static DatabaseLocator getInstance() {
    return instance;
  }
  /** Creates a new instance of DatabaseLocator */
  private DatabaseLocator() {
  }
  public Connection getConnection() throws SQLException, ClassNotFoundException
  {
      Class.forName("com.mysql.jdbc.Driver");
      Connection conn = 
        DriverManager.getConnection("jdbc:mysql://localhost/login", "root", "rootroot");
      return conn;
  }
}










